﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace NJT
{
    public static class 对话框
    {

        public static bool 操作确认(string 信息, string 标题)
        {
            var button = MessageBoxButton.YesNo;
            var icon = MessageBoxImage.Warning;
            var result = MessageBox.Show(信息, 标题, button, icon);

            switch (result)
            {
                case MessageBoxResult.Yes:
                    return true;
                case MessageBoxResult.No:
                    return false;
                case MessageBoxResult.Cancel:
                    return false;
                default:
                    return false;
            }
        }

        public static void 操作提示(string 信息, string 标题)
        {
            var button = MessageBoxButton.OK;
            var icon = MessageBoxImage.Warning;
            var result = MessageBox.Show(信息, 标题, button, icon);
        }
    }
}
